package ycj.learn.spring.ioc.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.AbstractApplicationContext;
import ycj.learn.spring.ioc.common.TradeService;

@Configuration
@ComponentScan("ycj.learn.spring.ioc.common")
public class Entry {


    public static void main(String[] args) {
        String buyer = "张三";
        String seller = "李四";
        int quantity = 10;

        AbstractApplicationContext context = new AnnotationConfigApplicationContext(Entry.class);
        TradeService trade = context.getBean(TradeService.class);


        trade.trade(buyer, seller, quantity);
    }


}
